public class Test6_10 {
    public static void main(String[] args) {
        MyAdd m1 = new MyAdd();
        m1.setX(102);
    }
}
class MyException extends Exception{
    public MyException(String message){
        super(message);
    }
}
class MyAdd{
    int x;
    public void setX(int x) {
        try {
            if (x < 0 || x > 100)
                throw new MyException("数字不在0到100的范围内");
            else
                this.x = x;
        } catch (MyException e) {
            System.out.println(e);
        }
    }
    public int getX(){
          return x;
        }
}

